package com.njbdqn.air.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.njbdqn.air.domain.Air;
import com.njbdqn.componses.bean.IPageDAO;
import com.njbdqn.componses.bean.PageParam;

public interface AirDAO extends IPageDAO<Air>{
	@Insert("insert into air(areaid,mtime,pm10,pm25,station,lasttime) values(#{areaid},#{mtime},#{pm10},#{pm25},#{station},#{lasttime})")
	public void save(Air air);
	@Delete("delete from air where airid=#{xxx}")
	public void delete(int airid);
	@Update("update air set areaid=#{areaid},mtime=#{mtime},pm10=#{pm10},pm25=#{pm25},station=#{station},lasttime=#{lasttime} where airid=#{airid}")
	public void update(Air air);
	@Select("select * from air where airid=#{xxx}")
	public Air findByAirId(int airid);
	@Select("select * from areas")
	public List<Air> findAllArea();
	
	public List<Air> findCurrentPageData(PageParam pip);
	public int getCountPage(PageParam pip);
}
